var con = require("../../../../utils/data.js");
Page({

  data: {
  },
  onLoad: function (options) {
    var that = this;
    // wx.request({
    //   url: con.hospital_getslide,
    //   method: 'GET',
    //   data: { wxappid: con.wyy_user_wxappid },
    //   header: {
    //     "Content-Type": "application/json"
    //   },
    //   success: function (res) {
    //     // console.log(res.data.info);
    //     that.setData({
    //       list: res.data.info
    //     })
    //     app.getUserInfo();
    //   } 
    // });
    var oneRequest = { "data": { "status": "1", "info": [{ "id": "17", "wxappid": "6", "info": "装修啦", "img": "http://www.weiyunyi.com/Uploads/20170714/596875c0e3698.png", "url": "测试地址" }, { "id": "18", "wxappid": "6", "info": "专修", "img": "http://www.weiyunyi.com/Uploads/20170714/596875903b58f.png", "url": "测试地址" }, { "id": "19", "wxappid": "6", "info": "地方", "img": "http://www.weiyunyi.com/Uploads/20170714/596875a17b67c.png", "url": "测试地址" }, { "id": "20", "wxappid": "6", "info": "1231", "img": "http://www.weiyunyi.com/Uploads/20170714/596875b286885.png", "url": "测试地址" }] }, "header": { "Server": "NWSs", "Date": "Fri, 29 Dec 2017 06:02:39 GMT", "Content-Type": "application/json; charset=utf-8", "Content-Length": "635", "Connection": "keep-alive", "Cache-Control": "must-revalidate, no-store", "Pragma": "no-cache", "X-Powered-By": "PHP/5.4.33,ASP.NET", "Set-Cookie": "PHPSESSID=1cn7kakkl54pdu8c3ubb82lnd4; path=/", "X-NWS-LOG-UUID": "c4587a2d-8105-4873-b958-bcbda642654f", "X-Daa-Tunnel": "hop_count=2" }, "statusCode": 200, "errMsg": "request:ok" };

    that.setData({
      list: oneRequest.data.info
    })


    // wx.request({
    //   url: con.gettarticallist,
    //   method: 'GET',
    //   data: { wxappid: con.wyy_user_wxappid, typeid: options.id },
    //   header: {
    //     "Content-Type": "application/json"
    //   },
    //   success: function (res) {
    //     // console.log(res.data.info);
    //     that.setData({
    //       articleTwo: res.data.info,
    //     })
    //   }
    // });
    var twoRequest = { "data": { "status": "1", "info": [{ "id": "6", "wxappid": "6", "typeid": "5", "title": "家装报价", "text": "因为你的家,就是我们的家,因为顾客,就是上帝,我们为上帝提供最优的服务,最适合的价钱", "details": "", "createtime": "2017-07-17", "img": "http://www.weiyunyi.com/Uploads/20170715/5969902c56885.jpg", "toppic": "20170715/5969673bd509c.jpg" }, { "id": "7", "wxappid": "6", "typeid": "5", "title": "公司装修报价", "text": "因为我们你将更实惠,因为我们你将得到更好的服务,更高的质量", "details": "", "createtime": "2017-07-15", "img": "http://www.weiyunyi.com/Uploads/20170715/596990363803d.jpg", "toppic": "20170715/596967b0ec79a.jpg" }] }, "header": { "Server": "NWSs", "Date": "Fri, 29 Dec 2017 08:22:55 GMT", "Content-Type": "application/json; charset=utf-8", "Content-Length": "894", "Connection": "keep-alive", "Cache-Control": "must-revalidate, no-store", "Pragma": "no-cache", "X-Powered-By": "PHP/5.4.33,ASP.NET", "Set-Cookie": "PHPSESSID=518a9ad7r7ljt56kd093cockk5; path=/", "X-NWS-LOG-UUID": "1f568252-18f3-48fa-8f39-9992b70097a2", "X-Daa-Tunnel": "hop_count=2" }, "statusCode": 200, "errMsg": "request:ok" };

    that.setData({
      articleTwo: twoRequest.data.info,
    })

  },
  bindViewDetail: function (e) {
    var len = e.currentTarget.dataset.id;
    wx.navigateTo({
      url: '../newsD/newsD?id=' + len,
    })
  }

})